package cn.jiangjiesheng.bootstrap.database;

import cn.jiangjiesheng.bootstrap.database.properties.MyDataSourceProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by dev@jiangjiesheng.cn on 2021/9/2  <br/>
 *
 * @author dev@jiangjiesheng.cn
 */
@Configuration
@Slf4j
@EnableConfigurationProperties({MyDataSourceProperties.class})
@AutoConfigureBefore(MyDataSourceAutoConfiguration.class)
public class MyDefaultConfiguration {

    @Bean
    @ConditionalOnMissingBean(MyDataSourceProperties.class)
    public MyDataSourceProperties myDataSourceProperties(MyDataSourceProperties myDataSourceProperties) {
        return myDataSourceProperties;
    }

}
